package com.bootdo.testDemo;

/**
 * @Auther: liuj
 * @Date: 2019/7/12 18:00
 * @Description:
 */
public class CycleWait implements Runnable {
    private String value;
    @Override
    public void run() {
        try {
            Thread.currentThread().sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        value = "hello.";
    }
    public static void main(String[] args){
        CycleWait cycleWait = new CycleWait();
        Thread t = new Thread(cycleWait);
        t.start();
//        try {
//            t.join();
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        try {
            Thread.currentThread().sleep(2500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(cycleWait.value);
    }
}
